<?php
namespace app\admin\validate;

use think\Validate;

class Recharge extends Validate
{
    protected $rule = [
        'price'  => 'require|number',
        'discount'  => 'number|length:2|min:1|max:99',
        'sort' => 'require|number'
    ];

    protected $message = [
        'price.require'  => '请输入金额',
        'price.number'  => '金额必须为数字',
        'discount.number'  => '打折必须为数字',
        'discount.length'  => '打折长度错误',
        'discount.length'  => '打折长度错误',
        'discount.min'  => '打折最小为1',
        'discount.max'  => '打折最大为99',
        'sort.require' => '请输入排序',
        'sort.number'  => '排序只能填写数字'
    ];
}